package ModelLayer;

import java.util.ArrayList;
import java.util.Date;

/**
 * Write a description of class DVD here.
 *
 * @author (your name)
 * @version (a version number or a date)
 */
public class DVD {
    // instance variables - replace the example below with your own
    private int id;
    private String title;
    private String artist;
    private Date publicationDate;
    private ArrayList<Copy> copies;

    /**
     * Constructor for objects of class DVD
     */
    public DVD(int id, String title, String artist) {
        this.id = id;
        this.title = title;
        this.artist = artist;
        this.publicationDate = new Date();// initialise instance variables
        copies = new ArrayList<Copy>();
    }

    public DVD() {
    }

    /**
     * An example of a method - replace this comment with your own
     * <p/>
     * Set og Get
     */
    public int getId() {
        return id;
    }

    public String getArtist() {
        return artist;
    }

    public String getTitle() {
        return title;
    }

    public Date getPublicationdate() {
        return publicationDate;
    }

    public Copy getCopy(int id) {
        return copies.get(id);
    }

    public int stockSize() {
        return copies.size();
    }

    public void setId(int id) {
        this.id = id;
    }//Irelevant?

    public void setArtist(String artist) {
        this.artist = artist;
    }

    public void setTitle(String title) {
        this.artist = artist;
    }

    public void setPublicationDate(Date publicationDate) {
        this.publicationDate = publicationDate;
    }

    public void addCopy(Copy newCopy) {
        copies.add(newCopy);
    }
}
